package com.sy.simpleegg.platform.kkb.network.base

import com.sy.simpleegg.platform.kkb.bean.device.RemoteDeviceConfigEntity
import com.sy.simpleegg.platform.kkb.bean.device.SubRegisterEntity
import com.ych.ytdevicesdk.entity.AppInfoEntity
import com.ych.ytdevicesdk.entity.MqDeviceSetRequestData
import io.reactivex.Observer

/**
 * @author sy
 * @date 2024/10/11 17:08
 * @desc
 */
interface IDeviceManager {
    fun getRemoteDeviceConfigData(): RemoteDeviceConfigEntity?

    fun pushDeviceSetting(var1: String?, var2: List<MqDeviceSetRequestData?>?)

    fun disMqConnect()

    fun getDeviceNumber(): String?

    fun initSdk(
        var1: String,
        var2: String,
        var3: String,
        var4: Int,
        var5: String,
        vararg var6: AppInfoEntity?,
    ): IDeviceManager?

    fun setAgreementInfo(var1: Int, var2: String, var3: String)

    fun getDeviceConfig()

    fun getDeviceConfig(var1: String?)

    fun getBaseBusinessUrl(): String?

    fun initSdk(
        var1: String?,
        var2: String?,
        var3: String?,
        var4: Int,
        var5: String?,
        var6: AppInfoEntity?,
        var7: InitListener?,
    ): IDeviceManager?

    fun setInitListener(var1: InitListener?): IDeviceManager?

    fun debugger(var1: Boolean, var2: Boolean): IDeviceManager?

    fun logger(var1: Boolean): IDeviceManager?

    fun connectTest(var1: IConnectTestResponse?): IDeviceManager?

    fun getMacId(): String?

    fun setEventListener(var1: IMqMessageListener?): IDeviceManager?

    fun getSdkVersion(): String?

    fun subDeviceRegister(
        var1: String?,
        var2: String?,
        var3: Int,
        var4: Int,
        var5: String?,
        var6: String?,
        var7: Observer<BaseResult<SubRegisterEntity?>?>?,
    )

    fun deviceErrorSubmit(var1: Int, var2: String?)


    interface IMqMessageListener {
        fun deviceBinding()
        fun deviceUnBinding()
        fun deviceReBoot()
        fun extractCoin(var1: String?): Int
        fun getDeviceSetting(var1: String?): Map<Int?, Any?>?
        fun setDeviceSetting(var1: String?): Int?
        fun changeCashPackage()
        fun updateOrder(var1: String?, var2: String?, var3: Int, var4: String?)
        fun deviceStatues(var1: Int)
        fun pushLog(msg: String?) {}
    }


    interface IConnectTestResponse {
        fun callBack(var1: Boolean, var2: String?)
    }


    interface InitListener {
        fun registerFailed(var1: Long, var3: String?)
        fun needUpdate(vararg var1: String?)
        fun bindStatus(var1: Boolean, var2: String?)
        fun onError(var1: String?, var2: Long, var4: String?)
    }


    @Retention(AnnotationRetention.SOURCE)
    annotation class ErrorType {
        companion object {
            const val REGISTER = "REGISTER"
            const val UPDATE = "UPDATE"
            const val BIND = "BIND"
            const val CONNECT = "CONNECT"
            const val HEARTBEAT = "heartbeat"
            const val DEVICE_ERROR = "DEVICE_ERROR"
        }
    }

}